package com.wtwd.campus.vcom.service;

import com.alibaba.fastjson.JSONObject;
import com.wtwd.campus.entity.PolygonFence;
import com.wtwd.campus.vcom.common.RespEntity;
import com.wtwd.campus.vcom.common.ResponseEntity;
import com.wtwd.campus.vcom.entity.AddOrgPolygonFenceDto;
import com.wtwd.campus.vcom.entity.VcomCircleFence;

import java.util.List;

/**
 * @Author: ldaoliang
 * @DateTime: 2022/1/7 10:49
 * @Description:
 */
public interface VcomFenceService {

    Integer ACTIVE_FENCE=1;

    Integer ACTIVE_NOT_FENCE=0;


    /**
     * 全量添加电子围栏
     *
     * @param jsonObject
     * @return
     */
    ResponseEntity addOriCircleFence(JSONObject jsonObject, List<String> imeis);

    /**
     * 增量新增围栏关联
     * 此处兼容多边形围栏 vcom保证fenceId在圆形围栏和多边形围栏中都处于唯一性
     *
     * @param fenceId
     * @param imeis
     * @return
     */
    ResponseEntity incrementAddFenceImei(String fenceId, List<String> imeis);

    /**
     * 删除围栏
     *
     * @param fenceId
     * @return
     */
    ResponseEntity delFence(String fenceId);

    /**
     * 增量删除围栏关联
     *
     * @param fenceId
     * @param imeis
     * @return
     */
    ResponseEntity incrementDelFenceImei(String fenceId, List<String> imeis);

    /**
     * 获取fenceId
     *
     * @param fenceId
     * @return
     */
    RespEntity getFenceInfo(String fenceId);

    /**
     * 获取威科姆围栏
     *
     * @param imei
     * @return
     */
    List<VcomCircleFence> getVcomActiveFenceByImei(String imei);

    VcomCircleFence getVcomFenceInfoByFenceId(String fenceId);

    /**
     * 全量新增多边形围栏
     * <p>
     * 1.修改当前围栏 2.清除原有该围栏的绑定关系 3.添加新的围栏绑定关系
     * 2.新增围栏并添加绑定关系
     *
     * @param addOrgPolygonFenceDto
     * @return
     */
    ResponseEntity addOrgPolygonFence(AddOrgPolygonFenceDto addOrgPolygonFenceDto);


    /**
     * 根据imei获取vcom的多边形围栏
     * @param imei
     * @return
     */
    List<PolygonFence> getPolygonFenceByImei(String imei,Integer active);
}
